//
//  SEInquirySettingViewModel.swift
//  SmartEyeForDoctor
//
//  Created by qdsg on 2021/5/5.
//

import UIKit

class SEInquirySettingViewModel: SEBaseViewModel {

    var userInfoModel = SEUserInfoModel()

    var settingFeeCellModel: SEInquirySettingFeeCellModel{
        return  SEInquirySettingFeeCellModel(title: "单次问诊价格",
                                             placeHolder: "请输入金额",
                                             text: String(format: "%.2lf", userInfoModel.fee / 100.0),
                                             unit: "元",
                                             cellType: .unit)
    }

    /// 设置单次问诊价格
    func setSingleInquiryPrice() {
//        if userInfoModel.fee == 0 {
//            SEHUD.showError(message: "请输入金额")
//            return
//        }
        SEHttpManager.shared.request(SEMineAPI.setSingleInquiryPrice(id: userInfoModel.id, fee: userInfoModel.fee), model: Any.self, withLoading: withLoading) { (result, httpStatus) in
            self.updateData?(httpStatus)
        }
    }
}
